home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d897.lha / EPP / PModules / skipNonWhite.e < prev    next >
Text File  |  1993-06-26  |  831b  |  24 lines

  1. OPT TURBO
  2.  
  3. PROC skipNonWhite (theString,  /* PTR TO STRING */
  4.                    startPos)   /* Char index into theString, passed by value */
  5.   DEF length
  6.  
  7.   /* Stops at SPACE, TAB, LF, CR.  Returns endPos so that                 */
  8.   /* MidStr (someString, theString, startPos, (endPos - startPos)) can be */
  9.   /* used in the calling program.                                         */
  10.   /* Return of -1 indicates access beyond end of string.                  */
  11.  
  12.   length := StrLen (theString)
  13.   IF startPos >= length THEN RETURN startPos
  14.  
  15.   WHILE (startPos < length) AND
  16.         ((theString [startPos] <> " ") AND
  17.          (theString [startPos] <> 9) AND   /* TAB */
  18.          (theString [startPos] <> 10) AND  /* LF */
  19.          (theString [startPos] <> 13))     /* CR */ DO INC startPos
  20.  
  21. ENDPROC  startPos
  22.   /* skipNonWhite */
  23.  
  24.